<?php defined('BASEPATH') or exit('No direct script access allowed'); ?>

<style>
	#login-page .dashboard-info-right{width:250px;padding: 0 6px 5px 7px;}
</style>

<form action="<?php echo site_url('authorization/submit_escort_login');?>" name="submit_escort_login" id="submit_escort_login" method="post" enctype="multipart/form-data" >

<div class="home-escort-list" id="login-page">
	<span style="line-height:30px;"><?php echo language_translate('escort_login_page_escort_login');?></span>
	<table>
	<tr>
		<td width="50%">
			<div class="dashboard-info-wrapper">
				<div class="dashboard-info-left">
					<span><?php echo language_translate('escort_login_page_username');?></span>
					<div class="help-text" title="<?php echo language_translate('escort_login_page_username_hint');?>"></div>
				</div>
				<div class="dashboard-info-right">
					<div class="select-box">
						<input type="text" name="username" id="username" value="" maxlength="45" class="text-box2">
						<div class="clear"></div>
						<div class="input-error" id="username_err"></div>
					</div>
				</div>
				<div class="clear"></div>
			</div>	
			
			<div class="dashboard-info-wrapper">
				<div class="dashboard-info-left">
					<span><?php echo language_translate('escort_login_page_password');?></span>
					<div class="help-text" title="<?php echo language_translate('escort_login_page_password_hint');?>"></div>
				</div>
				<div class="dashboard-info-right">
					<div class="select-box">
						<input type="password" name="password" id="password" value="" maxlength="45" class="text-box2">
						<div class="clear"></div>
						<div class="input-error" id="password_err"></div>
					</div>
				</div>
				<div class="clear"></div>
			</div>
			
			<div class="dashboard-info-wrapper">
				<div class="dashboard-info-left">
					<span><?php echo language_translate('escort_login_page_captcha');?></span>
					<div class="help-text" title="<?php echo language_translate('escort_login_page_captcha_hint');?>"></div>
				</div>
				<div class="dashboard-info-right">
					<div class="select-box">
						<div id="captcha-section">
							<?php echo newCaptcha();?> 
						</div>	
						<div id="captcha-reload"></div>
						<div class="clear"></div>
						<input type="text" name="captcha" id="captcha" value="" maxlength="45" class="text-box2" style="margin-top:5px;">
						<div class="clear"></div>
						<div class="input-error" id="captcha_err"></div>
					</div>
				</div>
				<div class="clear"></div>
			</div>
			
			<div class="dashboard-info-wrapper">
				<div class="dashboard-info-left"><span>&nbsp;</span></div>
				<div class="dashboard-info-right">
					<div class="select-box">
						<input type="submit" class="save-button" value="<?php echo language_translate('escort_login_page_signup');?>" /> 
						<?php echo loader_image("id='loader_image' class='hidden'");?>
					</div>
				 </div>
				<div class="clear"></div>
			</div>	 
			
			<div class="dashboard-info-wrapper">
				<div class="dashboard-info-left">
					&nbsp;
				</div>
				<div class="dashboard-info-right">
					<a href="<?php echo site_url_lang('authorization/forgot_details');?>"><?php echo language_translate('escort_login_page_forgot_link');?></a>
				</div>
				<div class="clear"></div>
			</div>
			
		</td>
		<td width="50%" style="vertical-align:top;padding-top:10px;padding-left:15px;">
			<?php $this->load->view('banner/login_page_banner',array('pos'=>'login_page') ); ?>
		</td>
	</tr>
	</table>	
</div>

<div class="bottom-content-wrapper">
	<?php $this->load->view('news/list_news',array('pos'=>'login') ); ?>
</div>
<div class="bottom-content-wrapper">
	<?php $this->load->view('banner/bottom_banner',array('pos'=>'login_page') ); ?>
</div>


</form>

		
<script type="text/javascript">
	$(document).ready(function() {
		var options = { 
			beforeSubmit:  validateB4Submit,  
			success:       processAfterResponding   
		};	
		$('#submit_escort_login').ajaxForm(options); 
		$('.help-text[title]').qtip({ style: { name: 'dark', tip: true } });
	});	
		
	function validateB4Submit(formData, jqForm, options){
		$('#loader_image').show();
		$('#username_err, #password_err').html('');
		return true;
	}

	function processAfterResponding(responseText, statusText, xhr, $form) {
		$('#loader_image').hide();	
		if(responseText == 'ok'){
			queryurl( BASE_URI+'authorization/login_confirm' );
		}else{
			var arr_res = responseText.split('#');
			for(i in arr_res){
				var e = arr_res[i].split('|');
				$('#'+e[0]).html(e[1]);
			}
		}
	}

</script>		
		